package com.example.hellosharding.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.hellosharding.auto.TUserMapper;
import com.example.hellosharding.auto.UserInfo;
import com.example.hellosharding.service.IUserInfoService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author fancheng
 * @since 2021-06-15
 */
@Service
public class TUserInfoServiceImpl extends ServiceImpl<TUserMapper, UserInfo> implements IUserInfoService {

    @Override
    public List<UserInfo> getList() {
        List<UserInfo> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            UserInfo userInfo = new UserInfo();
            userInfo.setName("张三==" + i);
            userInfo.setCreateTime(new Date());
            list.add(userInfo);
        }
        this.saveBatch(list);
        return list;
    }
}
